import * as React from 'react';

import {createStackNavigator} from '@react-navigation/stack';

import Home from '../pages/home';
import Splash from '../pages/splash';
import Login from '../pages/login';
import CloudPan from '../pages/cloudpan';
import RecentPlay from '../pages/recentplay';
import Collect from '../pages/collect';
import BroadCast from '../pages/broadcast';
import UserInfo from '../pages/userinfo';
import SongList from '../pages/songlist';
// import {getToken} from "../storage/token"
const FullStack = createStackNavigator();

function Router() {
  // console.log(getToken())
  return (
    <FullStack.Navigator initialRouteName="Login">
      <FullStack.Screen
        name="Splash"
        component={Splash}
        options={{headerShown: false}}
      />
      <FullStack.Screen
        name="Home"
        component={Home}
        options={{headerShown: false}}
      />
      <FullStack.Screen
        name="Login"
        component={Login}
        options={{headerShown: false}}
      />
      <FullStack.Screen name="CloudPan" component={CloudPan} />
      <FullStack.Screen name="RecentPlay" component={RecentPlay} />
      <FullStack.Screen name="Collect" component={Collect} />
      <FullStack.Screen name="BroadCast" component={BroadCast} />
      <FullStack.Screen
        name="UserInfo"
        component={UserInfo}
        options={{
          title: '',
          headerBackTitleVisible: false,
          headerStyle: {backgroundColor: '#111', shadowColor: '#111'},
          headerTintColor: '#fff',
        }}
      />
      <FullStack.Screen name="SongList" component={SongList} />
    </FullStack.Navigator>
  );
}

export default Router;
